# -*- coding: utf-8 -*-

person = {
    'name': '小明',
    'sex': '男',
    'age': 18,
    'year': 18
}
for k, v in person.items():  # 遍历键值对
    print(k, v)

for k in person.keys():     # 遍历所有键
    print(k)

for v in person.values():   # 遍历所有值
    print(v)

for v in set(person.values()):    # 使用集合过滤重复的value
    print(v)

for k in sorted(person.keys()):     # 按key的顺序遍历所有的value
    print(person[k])
